package com.meiyou.mapper;

import com.meiyou.annotation.AutoFill;
import com.meiyou.entity.Collect;
import com.meiyou.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @BelongsProject: meiyou
 * @BelongsPackage: com.meiyou.mapper
 * @Author: 尹晓安
 * @Date: 2023/11/25 18:10
 * @Description: todo
 */
@Mapper
public interface CollectMapper {

    /**
     * 添加数据，收藏
     *
     * @param collect
     */
    @AutoFill(value = OperationType.INSERT)
    void add(Collect collect);

    /**
     * 查询数据
     *
     * @param collect
     */
    Integer select(Collect collect);

    /**
     * 取消收藏
     *
     * @param collect
     */
    void delete(Collect collect);

    /**
     * 批量删除收藏文章
     *
     * @param ids
     * @return
     */
    void removeBatch(List<Long> ids);

    /**
     * 根据文章id删除点赞
     *
     * @param articleId 文章id
     */
    void removeByArticleId(Long articleId);
}
